package com.luo.shop.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.List;

@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        List<String> str = Arrays.asList("/address","/mygrxx","/remima","/order","/ok","/myorderq","/orderxq","/myprod","/wuliu","/cart","/mygxin");
        registry.addInterceptor(new portalLoginInterceptor()).addPathPatterns(str);
        registry.addInterceptor(new AdminLoginInterceptor()).addPathPatterns("/admin/*").excludePathPatterns("/admin/login");
}
}
